// JavaScript Document
$(document).ready(function () {

	$("#grid").kendoGrid({
		dataSource: {
			transport: {
				read: "teacher/read.php",
							update: {url:"teacher/update.php", type:"POST"},
							create: {url:"teacher/create.php",type:"POST"},
							destroy: {url:"teacher/delete.php",type:"POST"}
			},
			batch: true,
			schema: {
				model: {
					id: "id",
					fields: {
						id: { type: "number" },
						name: { type: "string"},
						degree: { type: "string" },
					}
				}
			},
			pageSize: 25
		},
		editable:  "inline",
		height: 400,
		filterable: true,
		sortable: true,
		pageable: true,
				 toolbar: ["create"],
		columns: [{	field:"name", title: "Họ tên",	filterable: true },
				  {	field: "degree", title: "Học vị",},
				  { command: [{text:"Edit record", name:"edit"}, {text:"Delete record",name:"destroy"}], title: " ", width: "210px" }
		]
	});

});